﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;

namespace NJT.Services
{
    public partial class 公共
    {
        private static Mutex _mutex; //建立字段.程序不退出,字段不回收.

        public static void 多启动限制(string 唯一字符串)
        {
            bool createdNew;
            _mutex = new System.Threading.Mutex(true, 唯一字符串, out createdNew);
            if (!createdNew)
            {
                System.Environment.Exit(0);
            }
        }
    }
}
